/**
 * 
 */
package biz.innovasoft.nodb.transaction;

import java.util.Date;
import java.util.List;

import org.prevayler.Prevayler;

import biz.innovasoft.nodb.UpdateableList;
import biz.innovasoft.nodb.impl.GenericRepository;
import biz.innovasoft.nodb.query.Tuple;
import biz.innovasoft.nodb.util.ArrayUpdateableList;

/**
 * 
 * @author Diego Miranda
 *
 */
public class GetAllQuery extends BaseQuery {

	public GetAllQuery (Prevayler prevayler) {
		super (prevayler);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Object query(GenericRepository repository, Date executionTime) throws Exception {
		List<Tuple> tuples = repository.getAll(true);
		UpdateableList ulist = new ArrayUpdateableList(prevayler, tuples);
		return ulist;
	}
	
	

}
